|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectga.core.individual.IndividualComparator<T>
T - The generic type of individuals.class IndividualComparator<T extends IIndividual<T>>
Comparator for sorting and comparing individuals.
Contains interval comparation method from D. Gong, G. Guo, "Interactive Genetic Algorithms with Interval Fitness of Evolutionary Individuals" .
| Nested Class Summary | |
|---|---|
private static class |
IndividualComparator.TestInterval
This class is just for testing. |
| Field Summary | |
|---|---|
private boolean |
descending
|
private java.util.Random |
rnd
|
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
IndividualComparator(boolean descending)
Create a new comparator. |
|
| Method Summary | |
|---|---|
int |
compare(T o1,
T o2)
|
private int |
compareInterval(IIntervalFitness o1,
IIntervalFitness o2)
Compare fitness intervals. |
private int |
compareNumber(IFitness o1,
IFitness o2)
Simply compare point fitness. |
private double |
getDominationProbability(IIntervalFitness o1,
IIntervalFitness o2)
Calculates the probability that one interval dominates another. |
static void |
main(java.lang.String[] args)
A main class to test behavior. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Field Detail |
|---|
private static final long serialVersionUID
private final boolean descending
private final java.util.Random rnd
| Constructor Detail |
|---|
public IndividualComparator(boolean descending)
descending - Sort descending, if true.| Method Detail |
|---|
public int compare(T o1,
T o2)
compare in interface java.util.Comparator<T extends IIndividual<T>>
private int compareNumber(IFitness o1,
IFitness o2)
o1 - Fitness 1o2 - Fitness 2
private int compareInterval(IIntervalFitness o1,
IIntervalFitness o2)
o1 - Fitness 1o2 - Fitness 2
private double getDominationProbability(IIntervalFitness o1,
IIntervalFitness o2)
o1 - The first interval.o2 - The second interval.
public static void main(java.lang.String[] args)
args - Args
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||